<?php
class listremovedAction extends sfActions
{
	public function execute()
	{
	    $limit = 20;
		$this->page = $this->getRequestParameter('page',1);
		$filters = null;
	    if ($this->getRequest()->hasParameter('filter')){
	    	$val = $this->getRequestParameter('filters');
			$filters['id'] = $val['id'];    
			$filters['name'] = $val['name'];    
			$filters['rbtcode'] = $val['rbt_code'];    
	    }
	    $this->filters = $filters;
    
		$total = RingtonePeer::getTotalDeleted($this->filters);
		#$this->totalPage = intval($total/$limit);
		$this->totalPage = floor($total/$limit);
		if (($total/ $limit) - $this->totalPage > 0){
			$this->totalPage += 1;
		}
		if($this->page > $this->totalPage && $this->totalPage>0){
			$this->page = $this->totalPage;
		}
		$offset = ($this->page-1)*$limit;
		$this->pager= RingtonePeer::getlistDeleted($limit, $offset,$this->filters);	
		$this->total = $total;
	}
}
?>